export default store => {
  // 初始化调用,如果本地存储中有state信息直接读取
  if (localStorage.state) {
    store.replaceState(JSON.parse(localStorage.state))
  }
  store.subscribe((mutations, state) => {
    localStorage.state = JSON.stringify(state)
  })
}
